{extend name="layout" /}

{block name="content"}
    <div class="site-text site-block" style="margin: 15px">
        <blockquote class="layui-elem-quote">
            <h1>添加分类</h1>
        </blockquote>
        <form class="layui-form" action="/admin/category/addCategory" method="post" enctype="multipart/form-data">

            <div class="layui-form-item">
                <label class="layui-form-label">分类名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" required="required" value="" lay-verify="required" placeholder="请输入分类名称" autocomplete="on" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">分类图片</label>
                <div class="layui-box layui-upload-button" >
                    <input id="file" type="file" accept="" name="topic_img" class="">
                    <span class="layui-upload-icon"><i class="layui-icon"></i>上传图片</span>
                </div>
                <div style="display: inline-block; margin-left: 15px">
                    仅支持小于<span style="color: red">2M</span>的图片
                </div>
                <div id="logo-file-wrap">
                    <img src="" alt="">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">分类描述</label>
                <div class="layui-input-block">
                    <textarea name="description" placeholder="请输入内容" class="layui-textarea"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>

        </form>
    </div>
{/block}

{block name="script"}
<script src="__admin__/js/mine.js"></script>
    <script>
        layui.use(['laydate','form'], function(){

        });
        $('#file').addImg({
            target:'#logo-file-wrap',
            size:2
        });
    </script>
{/block}